/*
 * @Company: TWL
 * @Author: xue jian
 * @Email: xuejian@kanzhun.com
 * @Date: 2020-02-06 17:14:31
 */
#include "test.h"
#include <fstream>
int main() {
    std::string zk_url = "172.21.32.168:2181,172.21.32.136:2181,172.21.32.113:2181,172.21.32.116:2181,172.21.32.196:2181";
    std::string zk_path = "/algorithm_research_center/group6/hulk_proxy/meta";
    std::shared_ptr<tcmcp_HulkProxyServClient> client(new tcmcp_HulkProxyServClient(zk_url, zk_path, 1, 100000));
    if (client->init()) {
        std::cout<<"init the client fail ... "<<std::endl;
        exit(1);
    }

    std::ifstream binfile("/data1/arc_six/wuxiushan/xgboost_test/gbdt.bin", std::ios::in | std::ios::binary);
    char buffer;
    std::string model;
    while (binfile.read(&buffer, 1)) {
        model += buffer;
    }

    client->tcmcp_hpush("xgboost_20200207", "model", model);
    client->tcmcp_hpush("xgboost_20200207", "type", "xgboost");
}